import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import {FetchService} from "../../../core/net/fetch.service";

@Component({
    selector: 'app-warnings',
    templateUrl: './warnings.component.html',
    styleUrls: ['./warnings.component.scss']
})
export class WarningsComponent implements OnInit {
    searchForm: FormGroup;
    tableData = [];
    constructor(private fb: FormBuilder,
                private fetchService: FetchService
                ) {
        this.searchForm = this.fb.group({
            name: [null]
        });
    }

    ngOnInit(): void {
        this.queryInfo();
    }

    queryInfo(): void {
        const params = this.searchForm.value;
        this.fetchService.post<any>('sys/yjqErrorB/list', params).subscribe(res => {
            console.log(res);
            this.tableData = res.list;
        });
    }
}
